#!/bin/bash
set -e

PKG_VERSION=`node -p "require('./package').version"`
echo $PKG_VERSION

## package to binary
pkg -t node12-linux-x64 --out-path output .
#pkg -t node12-linux-x64,node12-macos-x64,node12-win-x64 --out-path output .

## rename and zip output files
cd output
for f in sim-agent*;
do 
	filename=sim-agent-v${PKG_VERSION}${f##*sim-agent}
	mv $f $filename
done